import { Pipe, PipeTransform } from '@angular/core';

import { DictService } from '../../core/dict/dict.service';

@Pipe({
  name: 'bzDictMap'
})
export class DictMapPipe<U, D> implements PipeTransform {

  constructor(private dictService: DictService<U, D>) {

  }

  transform(dictValue: string, dictKey: D, dictType?: string, params?: any): Promise<string> {

    return this.dictService.getValue(dictKey, dictValue, dictType, params);
  }

}
